1
general::
Put up with unpleasantness, learn one's lesson. For example, After failing math, he had to take his medicine and go to summer school. This idiom uses medicine in the sense of "a bitter-tasting remedy." [Mid-1800s]
American Heritage Idioms